using System;

namespace KodeIT.Web
{
    /// <summary>
    /// Provides filter initialization and disposal events to the implementing class.
    /// </summary>
    /// <remarks>
    /// An HTTP Filter is an assembly that is called on every request made to IIS. HTTP modules are called as part 
    /// of the IIS request pipeline and have access to life cycle events throughout the request. HTTP Filter therefore 
    /// give you the opportunity to examine incoming requests and take action based on the request. They also give 
    /// you the opportunity to examine the outbound response and modify it.
    /// </remarks>
    public interface IHttpFilter
    {
        /// <summary>
        /// Initializes a filter and prepares it to handle requests.
        /// </summary>
        /// <param name="events">The possible events the filter can subscribe to.</param>
        /// <remarks>
        /// Use the <see cref="Init"/> method to register event handling methods with specific events.
        /// </remarks>
        void Init(IFilterEvents events);

        /// <summary>
        /// Disposes of the resources (other than memory) used by the filter that implements IHttpFilter.
        /// </summary>
        /// <remarks>
        /// The <see cref="Dispose"/> method performs any final cleanup work prior to removal of the filter from the 
        /// execution pipeline.
        /// </remarks>
        void Dispose();
    }
}
